<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
</head>
<style>
    .wenzi {
        padding: 10px;
        font-size: 14px;
    }

    .none {
        display: none;
    }


</style>
<style media="print">
    .none {
        display: block;
    }

    @page {
        size: auto;  /* auto is the initial value */

        margin: 10px 0;
    }

    td > p {
        max-width: 140px;
        overflow: hidden;
    }
</style>
<body>
<div id="rrapp" v-cloak>
    <div style="margin: 10px 0;">
        <div class="input-group" style="
        width: 150px;line-height: 40px; display: inline-block">
            <input type="text" autocomplete="off" id="sea"
                   placeholder="关键字" class="layui-input">
        </div>
        <select type="text" style="width: 150px; margin-left: 50px;" id="types" class="selectpicker "
                placeholder="预审状态">
            <option value="">全部</option>
            <option value="0">待预审</option>
            <option value="1">已预审</option>

        </select>

        <button type="button" onclick="init()" class="btn btn-primary">查询</button>
        <button type="button" class="btn btn-primary dayin">打印</button>
    </div>
    <div id="jqGridtable">
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div id="printOne" class="none" style="padding: 10px 15px;">
        <h3 style="text-align: center;margin-bottom: 10px ">提案列表</h3>
        <table class="table table-bordered" media="print">
            <thead>
            <tr>
                <th style=" width: 80px;">序号</th>
                <th style="width: 360px;">提案名称</th>
                <th style="width: 180px;">提案类型</th>
<!--                <th style="width: 180px;">案由分析</th>-->
<!--                <th style="width: 180px;">措施建议</th>-->
                <th style="width: 180px;">提案人</th>
                <th style="width: 180px;">所属部门</th>
            </tr>
            </thead>
            <tbody class="tablebody">

            </tbody>
        </table>
    </div>
</div>
<script src="${request.contextPath}/statics/js/modules/sys/tiananyushen.js?_${.now?long}"></script>
<script>
    $(function () {
        $(".dayin").click(function () {
            $.ajax({
                type: "get",
                url: baseURL + 'sys/tianan/listyushen?yushenstatus=1&limit=500',
                success: function (r) {
                    if (r.page) {
                        $(".tablebody").html("");
                        if (r.page.list.length > 0) {
                            for (var i = 0; i < r.page.list.length; i++) {
                                var data = r.page.list;
                                $(".tablebody").append('<tr><td >' + (i + 1) + '</td><td>' + data[i].title + '</td>' +
                                    '<td >' + data[i].typesName + '</td>' +
                                    '<td >' + data[i].creatusername + '</td><td >' + data[i].deptIdName + '</td></tr>');
                            }

                            $("#printOne").print({
                                globalStyles: true,
                                mediaPrint: false,
                                // stylesheet: null,
                                noPrintSelector: ".no-print",
                                iframe: true,
                                append: null,
                                prepend: null,
                                manuallyCopyFormValues: true,
                                deferred: $.Deferred(),
                                timeout: 1000,
                                title: null,
                                doctype: '<!doctype html>'
                            });
                        }
                    }
                }
            });


        })
    })

</script>

</body>
</html>
